;SLIDE Silver Library 

 INCLUDE "libraries.inc"

 CreateLibrary Silver,IfSilver,IfNSilver,FastSpeed,SlowSpeed,DelayMilli


 IFDEF __DelayMilli
_DelayMilli_:
       in     a,(2)
       rlca   
       ret    nc
       ld     a,41h
       out    (30h),a
       call   LdHLIndConvVal
       ld     a,01
       out    (31h),a
       out    (32h),a
_DelayMilliLoop:
       in     a,(4)
       bit    5,a
       jr     z,_DelayMilliLoop
       ld     a,1
       out    (31h),a
       dec    hl
       ld     a,h
       or     l
       jr     nz,_DelayMilliLoop
       xor    a
       out    (30h),a
       out    (31h),a
       ret
 ENDIF


 IFDEF __IfSilver
_IfSilver_:
       in     a,(2)
       rlca
       ret    c
       jp     SkipNextCmdRet
 ENDIF

 IFDEF __IfNSilver
_IfNSilver_:
       in     a,(2)
       rlca
       ret    nc
       jp     SkipNextCmdRet
 ENDIF

 IFDEF __FastSpeed
_FastSpeed_:
       in     a,(2)
       rlca
       ret    nc
       ld     a,1
       out    (20h),a
       ret
 ENDIF

 IFDEF __SlowSpeed
 _SlowSpeed_:
       in     a,(2)
       rlca
       ret    nc
       xor    a
       out    (20h),a
       ret
 ENDIF

SilverNext:

 IFDEF _S_IfSilver
       db     2
 ENDIF
 IFDEF _S_IfNSilver
       db     2
 ENDIF
 IFDEF _S_FastSpeed
       db     2
 ENDIF
 IFDEF _S_SlowSpeed
       db     2
 ENDIF
 IFDEF _S_DelayMilli
       db     4
 ENDIF

